<?php
/**
 +------------------------------------------------------------------------------
 * 产品操作公共类
 +------------------------------------------------------------------------------
 * @category   Com
 * @package
 * ProductCatModel 分类产品关联视图 <br>
 * ProductDescAndPriceModel 产品价格、描述关联视图<br>
 * @author   朝闻道 <Admin@iic.cn>
 * @version  $Id$
 +------------------------------------------------------------------------------
 */
class Iic{
	
	/**
	*获取产品的描述及价格
	*@date 2013-9-20
	*@time 下午10:54:56
	*/
	static function desc_and_price($ids=array(),$field='*') {
	//获取产品的描述及价格
		$dao=D('ProductDescAndPrice');
		$where=$data=array();
		if(is_array($ids)){
			$where['product_id']=array('IN',implode(',', $ids));
		}else{
			$where['product_id']=$ids;
		}
		$data=$dao->field($field)->where($where)->select();
		return field2key($data,'product_id');
	}//end desc_and_price
	
	/**
	*获取产品的描述
	*@date 2013-9-20
	*@time 下午10:55:31
	*/
	static function desc($ids=array(),$field='*') {
	//获取产品的描述
		$dao=M('ProductDescription');
		$where=$data=array();
		if(is_array($ids)){
			$where['product_id']=array('IN',implode(',', $ids));
		}else{
			$where['product_id']=$ids;
		}
		$data=$dao->field($field)->where($where)->select();
		return field2key($data,'product_id');
	}//end desc
	
}